package com.lcb.thread;

import com.sun.org.apache.xerces.internal.impl.dv.xs.YearDV;

public class Test {

//    1.获取到圆心的X坐标,Y坐标,半径
//    2.判断这个点的横纵坐标
//    3.如果这个的坐标全大于圆心的X坐标+半径,Y坐标+半径,则在圆外
//    4.小于则在园内

    public static void main(String[] args) {

        Person[] person = {
                new Person(1, "1")
                , new Person(2, "2")
                , new Person(3, "3")
                , new Person(4, "4")
                , new Person(5, "5")};
        System.out.println(person);
        int[] arr = {5, 1, 4, 3, 2};
        Person temp = null;
        for (int i = 0; i < person.length; i++) {
            temp = person[i];
            for (int j = 0; j < person.length; j++) {
                if (person[j].getId() == arr[i]) {
                    person[i] = person[j];
                    person[j] = temp;
                }
            }
        }
        System.out.println(person.toString());

    }

    static class Person {
        private int id;
        private String name;

        public Person(int id, String name) {
            this.id = id;
            this.name = name;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @Override
        public String toString() {
            return "Person{" +
                    "id=" + id +
                    ", name='" + name + '\'' +
                    '}';
        }
    }
}
